package com.bos.data.repositories.impl;

import com.bos.common.ResultData;
import com.bos.data.repositories.SalesRepository;
import com.bos.data.repositories.UserRepository;
import org.apache.catalina.User;
import org.springframework.stereotype.Repository;
import org.springframework.transaction.annotation.Transactional;

import java.util.HashMap;
import java.util.List;
import java.util.Map;

/**
 * create by luojie 2018/6/9
 */
@Repository
@Transactional
public class UserRepositoryImpl extends BaseRepository implements UserRepository {
    public List getRole(int uid){
        String sql=" SELECT d.* FROM bos_user a " +
                   " LEFT JOIN bos_user_role b on a.id=b.userId " +
                   " RIGHT JOIN bos_role_node c on b.roleId=c.roleId " +
                   " LEFT JOIN bos_node d on c.nodeId=d.id " +
                   " WHERE a.id =:id ";
        Map map=new HashMap();
        map.put("id",uid);
        return this.getList(sql,map);
    }
}
